package com.academico.web.servlet.matricula;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.academico.dao.MatriculaDAO;
import com.academico.model.Matricula;
import com.academico.web.servlet.BaseServlet;

public class PopulateMatriculaServlet extends BaseServlet {

	private static final long serialVersionUID = 8139795236043402251L;

	@Override
	public void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		MatriculaDAO matriculaDAO = new MatriculaDAO();
		List<Matricula> matriculas = matriculaDAO.findAll();
		request.setAttribute("matriculas", matriculas);
		forward("matricula.jsp", request, response);
	}

}
